package com.hs.communication.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum Device {
    CHARGER(0x00),
    UPS(0x01),
    INVERTER(0x02),
    ;

    private int value;

    public static Device fromValue(int value) {
        for (Device device : Device.values()) {
            if (device.value == value) {
                return device;
            }
        }
        return null;
    }
}
